<link href="/css/box_list.css" rel="stylesheet" media="screen">
<ol class="breadcrumb">
    <li><a href="#">奇妙云箱</a></li>
    <li><a href="/box/list">箱子管理</a></li>
    <li>箱门状态</li>
</ol>
<div class="panel panel-default">
    <div class="panel-heading">
        <i class="icon-list-alt icon-large"></i>
        <span class="panel-title">状态列表</span>
    </div>
    <div class="panel-body">
        <div class="col-xs-2">
            <a class="btn btn-danger btn-sm"
               href="/box/doors?doorsnum=<%= doordatas.length %>&boxid=<%= boxid %>&index=all">填充产品</a>
        </div>
        <div class="col-xs-3 col-xs-offset-7">
            <label class="control-label">中奖后箱门状态</label>

            <div class="btn-group" role="group">
                <a class="btn btn-sm <%= limit ? 'btn-default' : 'btn-success' %>"
                   href="/box_management/boxlimit?box_id=<%= boxid %>&limit=false">
                    <span>不影响</span>
                </a>
                <a class="btn btn-sm <%= limit ? 'btn-success' : 'btn-default' %>"
                   href="/box_management/boxlimit?box_id=<%= boxid %>&limit=true">
                    <span>受影响</span>
                </a>
            </div>
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th>箱门序号</th>
                <th>箱门状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <% doordatas.forEach(function(door){ %>
            <tr>
                <td>
                    <label><%= door.index %></label>
                </td>
                <td>
                    <% if(door.empty){ %>
                    <div>空闲</div>
                    <% }else{ %>
                    <span>占用</span>
                    <% } %>
                </td>
                <td>
                    <a href="/box/doors?index=<%= door.index %>&boxid=<%= boxid %>">打开</a>
                </td>
            </tr>
            <% }); %>
        </table>
    </div>
</div>